﻿@{
    Layout = null;
}
<style>
    /** {
        padding: 0;
        margin: 0;
        font-family: 微软雅黑;
    }*/

    .red-con {
        width: 100%;
        height: 100%;
        background: url("/Content/webImgs/Market/redPacket/redPacket.gif");
        background-size:100% 100%;
        position: absolute;
        overflow: hidden;
    }

        .red-con .clickRequest {
            position: absolute;
            bottom: 5%;
            right: 0;
            left: 0;
            margin: 0 auto;
            width: 70%;
            height: 55px;
            line-height: 55px;
            text-align: center;
            background-color: #F9BF26;
            border-radius: 15px;
            color: #763401;
            font-size: 27px;
            font-weight: 700;
        }

        .red-con .bg-con {
            width: 100%;
            height: 100%;
            position: absolute;
            left: 0;
            top: 0;
            background-color: rgba(27, 1, 0, 0.8);
            display: none;
        }

            .red-con .bg-con .small-bg {
                width: 100%;
                height: 50%;
                position: absolute;
                left: 0;
                bottom: -50%;
                background: url("/Content/webImgs/Market/redPacket/redPacket-02B.png");
                background-size: 100% 100%;
                z-index: 10;
            }

                .red-con .bg-con .small-bg > p:nth-child(1) {
                    text-align: center;
                    color: #FBCE02;
                    font-size: 25px;
                    margin: 2px auto 0;
                }

                    .red-con .bg-con .small-bg > p:nth-child(1) > span {
                        color: #FBCE02;
                        font-size: 50px;
                        font-weight: 600;
                        text-align: center;
                    }

                .red-con .bg-con .small-bg > p:nth-child(2) {
                    font-size: 23px;
                    text-align: center;
                    color: whitesmoke;
                }

                .red-con .bg-con .small-bg > p:nth-child(3) {
                    font-size: 20px;
                    text-align: center;
                    color: whitesmoke;
                }

                .red-con .bg-con .small-bg > a.add {
                    display: block;
                    text-decoration: none;
                    margin: 0 auto;
                    width: 86%;
                    height: 50px;
                    line-height: 50px;
                    text-align: center;
                    background-color: #FFCC00;
                    border-radius: 10px;
                    color: #763401;
                    font-size: 20px;
                    font-weight: 700;
                }
</style>
<div class="red-con">
    <div class="clickRequest animated swing">
        点击领取红包
    </div>
    <div class="bg-con">
        <div class="small-bg">
            <p class="" style="margin-top:15px;">
                <span id="showMoney">@*1.00*@</span>元
            </p>
            <p id="company">
                @*码管家云系统*@
            </p>
            <p id="Congrats">
                @*恭喜您获得微信现金红包*@
            </p>
            <a class="add" href="javascript:$(' #phone .modal-body .phone-show > #show-con').load('/Market/WebTemplate1_2')">
                立即领取红包
            </a>
        </div>

    </div>


</div>
<script>

    $(function () {
        //       var height=window.innerHeight;
        //        console.log(height);
        //        $('.small-bg').css('height',height*0.4);
        setTimeout(function () {

            $('.red-con').css({ 'background': 'url("/Content/webImgs/Market/redPacket/redPacket-01.jpg")', 'backgroundSize': '100% 100%' });
        }, 500);
        $('.clickRequest').click(function () {
            var that = this;
            $(this).next('.bg-con').slideDown(function () {
                $(that).next('.bg-con').children('.small-bg').animate({
                    bottom: 0
                });
                $(that).next('.bg-con').children('.small-bg').children('p:nth-child(1)').addClass('animated bounceInLeft');
                $(that).next('.bg-con').children('.small-bg').children('a.add').addClass('animated  zoomIn');
                //
            });
            //获取url参数值
            function getUrlParam(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
                var r = window.location.search.substr(1).match(reg);  //匹配目标参数  window.location.search获取？之后字符串
                if (r != null) {
                    return unescape(r[2]);  //解码返回参数值
                }
                else {
                    return null; //返回参数值
                }
            }

            $.ajax({
                type: "get",
                url: ' /Market/GetAwards',
                data: { Aid: localStorage.getItem('Id') },
                success: function (data) {
                    //console.log(data);
                    if (data.Denomination==-1)
                    {
                        $('.bg-con .small-bg #showMoney').parent().html("奖品已被领完！").next().text(data.EnterpriseName).next().text(data.Congrats);

                    }
                    else {
                        $('.bg-con .small-bg #showMoney').text(data.Denomination).parent().next().text(data.EnterpriseName).next().text(data.Congrats);

                    }
                  
           
                }
            });
        })
    });
</script>